package com.eascs.applyLoan.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.eascs.common.util.UrlUtil;
import com.eascs.admin.common.controller.BaseMasterViewController;
import com.eascs.applyLoan.dao.O2oLoanInfoDao;
import com.eascs.applyLoan.entity.O2oLoanEntity;
import com.eascs.applyLoan.entity.O2oLoanInforEntity;
import com.eascs.applyLoan.service.O2oLoanInfoService;
import com.eascs.site.view.ViewContext;
import com.eascs.tag.MenuTag;

@Controller
@RequestMapping("/rlLoan")
public class O2oLoanInfoListController extends BaseMasterViewController{
	
	@Override
	public void preHandle() {
		ViewContext.put(MenuTag.CURRENT_MENU_CODE, "loanManege");
	}
	
	@Autowired
	O2oLoanInfoService o2oLoanInfoService;
	@Autowired
	O2oLoanInfoDao o2oLoanInfoDao;
	@RequestMapping("/rla")
	public String index(O2oLoanInforEntity oe) {
		oe.setPageSize(10);
		// 若startDate 与 endDate相同，则默认为查询当天所有贷款信息
		String pageUrl = "/restLoan/rApply";
		// 分页url
	pageUrl = UrlUtil.appendUrl(pageUrl, "province", oe.getProvince() == null ? "" : oe.getProvince());
    pageUrl = UrlUtil.appendUrl(pageUrl, "city", oe.getCity() == null ? "" : oe.getCity());
	pageUrl = UrlUtil.appendUrl(pageUrl, "startDate", oe.getStartDate() == null ? "" : oe.getStartDate());
	pageUrl = UrlUtil.appendUrl(pageUrl, "endDate", oe.getEndDate() == null ? "" : oe.getEndDate());
		pageUrl = pageUrl + "&pageIndex=";
		ViewContext.put("vo", oe);
		ViewContext.put("pageUrl", pageUrl);
		return "/applyLoan/applyLoan";
	}
	
	
}